module FlashesHelper
  FLASH_CLASSES = { danger: "danger", success: "success", warning: "warning", info: "info", primary: "primary"}.freeze

  def flash_class(key)
    FLASH_CLASSES.fetch key.to_sym, key
  end

  def user_facing_flashes
    flash.to_hash.slice "danger", "success", "warning", "info", "primary"
  end
end